package LUCKY.Android;

import java.util.Timer;

import LUCKY.Android.BusinessEntities.UsuarioBE;
import LUCKY.Android.ResourceAccess.TimerCheckNewMaintenances;
import LUCKY.Android.ResourceAccess.TimerRespaldoBD;
import android.app.Activity;
import android.app.NotificationManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.res.Resources;
import android.os.Handler;
import android.widget.TextView;

import com.google.code.microlog4android.Logger;
import com.google.code.microlog4android.LoggerFactory;

public class valoresGenerales{       
	
	public static final boolean isTestingVersion = true;
	//public static final boolean KaoriTestingVersion = false;
	
	public static Activity p_actMenu; 
	public static ProgressDialog progressDialog=null;
	//public static ProgressDialog progressDialogManten;
	//public static ProgressBar progressBar=null;
	public static TextView progressText=null;
	public static int mProgress=0;
	public static Handler mProgressHandler=null;
	public static final int MAX_PROGRESS = 100;

	public static boolean primera_sincronizacion=false;
	public static boolean activityVisible;
	public static boolean activitysinsincronizacion = true;
	
	public static boolean activar_tablas_aux=false;
	
	public static Timer mTimerSincroManten;
	public static TimerCheckNewMaintenances timerCheckNewMaintenances;
	public static actListanimales actListanimales=null;
	
	public static String actualizarotexistentes="";
	public static String DB_FILEPATH = "/data/data/LUCKY.Android/databases/";
	public static Timer mTimerTablasAux;
	public static boolean gettingTablaAux=false;
	public static boolean gettingSincroManten=false;
	
	public static boolean errortableaux = false;

	//public static boolean gettingEnvMasivo=false;
	
	//estas variables son usadas para las notificaciones
	public static int otsnuevas = 0;
	public static int otsactualizadas =0;
	
	
	public static final int INTENTOS_CONEXION=3;
	
	public static SharedPreferences sharedPrefs;
	public static NotificationManager mNotificationManager;
	public static Context mContext;
	//Permite acceder a getters para obtener los recursos
	public static Resources mResources;
	
	public static String DATABASE_NAME;
	
	public static final int DATABASE_VERSION = 1;
	
	public final static String NAMESPACE = "http://pda.lucky/";
	
	public static String EXT_STORAGE_DIRECTORY;
	public static String EXT_STORAGE_DIRECTORY_FIRMAS;
	public static String EXT_STORAGE_DIRECTORY_LOG;
	public static String EXT_STORAGE_DIRECTORY_VERSION;
	public static String EXT_STORAGE_DIRECTORY_IMAGENOT;
	public static String EXT_STORAGE_DIRECTORY_HISTORIAL;
	public static String EXT_STORAGE_DIRECTORY_RESPALDO_AUTOMATICO;
	
	
	public static String queryconfiltro;
	
	
	
	//public static String customer="";
	
	
	public static UsuarioBE beanUsuario;
	
	private static final Logger logger = LoggerFactory.getLogger();
	
	public static PackageInfo pinfo;
	
	/*public static final String customerIJT="IJT";
	public static final String customerEULEN="EULEN";
	public static final String customerGESTAGUA="GESTAGUA";*/
	//public static enum CUSTOMERS{IJT,EULEN,GESTAGUA,GENERICO};
	
	public static final String MANTEN_READY = "MANTEN_READY";
	public static final String FILTRO_READY = "FILTRO_READY";
	public static final String AUX_READY = "AUX_READY";
	
	
	
	
	public static Timer mTimerRespaldoBD;
	public static TimerRespaldoBD timerRespaldoBD;
	public static boolean gettingRespaldoBD=false;
	
	
	
	
	
	//no es estandar
	public static boolean isCustomerLUCKY() {
		return sharedPrefs.getString("customer", "").equals("LUCKY");
	}
	
	public static String WebServiceURL() {

		String url = sharedPrefs.getString("pref_web_service", "");
		return sharedPrefs.getString("pref_web_service", "");
	}
	
	public static boolean modoOffline = false;

	/*public static void ShowNotification(String contentTitle, String contentText, Intent contentIntent) {
	
		int icon = R.drawable.notification_icon;
		CharSequence tickerText = "Hello";
		long when = System.currentTimeMillis();

		Notification notification = new Notification(icon, tickerText, when);

		Intent notificationIntent = new Intent(this, MyClass.class);
		PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

		notification.setLatestEventInfo(mContext, contentTitle, contentText, contentIntent);
	
	}*/
	
}

